﻿@model MvcMusicStore.Album
@{
    ViewBag.Title = "Album - " + Model.titleAlbum;
}
<h2>
    Album: @Model.titleAlbum</h2>
<p>
    <img alt="@Model.titleAlbum"src="@Model.coverAlbum" />
</p>
<div id="album-details">
    <p>
        <em>Genre:</em>
        @Model.Genre.nameGenre
    </p>
    <p>
        <em>Artist:</em>
        @Model.Author.nameAuthor
    </p>
    <p>
        <em>Price:</em>
        @String.Format("{0:F}", Model.coustAlbum) $
    </p>
    @if (Model.aspnet_Users.Any(a => a.UserName == User.Identity.Name))
    {
        <strong class="button">Already bought</strong>
    }
    else
    {
        <p class="button">
            @Html.ActionLink("Buy it now!", "PurchaseAlbum", "Cart", new { id = Model.id }, "")
        </p>
    }
</div>
<div id="compositions">
    <h2>
        Compositions</h2>
    <ul id="songs">
        @foreach (var song in Model.Song)
        {
            <li>
                @Html.ActionLink(song.titleSong, "Song", new { id = song.id })
                <span>
                    <embed type="application/x-shockwave-flash" src="/Player/Simple.swf" flashvars="foreColor=#0088CC&amp;analytics=false&amp;filename=/Store/Download/@(song.id)"
         quality="high" wmode="transparent" width="18" height="18" bgcolor="#FFFFFF"/>
                </span>
                <p>
                    <em>Price:</em>
                    @String.Format("{0:F}", song.costSong) $</p>
            </li>
        }
    </ul>
</div>
